package com.geng.connect;

/**
 * 为了使两种连接方式适配，所以传递该类
 * 可以使用构造者模式
 */
public class ChannelPara {
    private String socket;
    private String remoteAppKey;
    private String groupName;

    public String getSocket() {
        return socket;
    }

    public String getRemoteAppKey() {
        return remoteAppKey;
    }

    public String getGroupName() {
        return groupName;
    }

    public ChannelPara(Builder builder) {
        this.socket = builder.socket;
        this.remoteAppKey = builder.remoteAppKey;
        this.groupName = builder.groupName;
    }

    public static class Builder{
        private String socket;
        private String remoteAppKey;
        private String groupName;

        public Builder(){}

        public Builder socket(String socket){
            this.socket = socket;
            return this;
        }
        public Builder remoteAppKey(String remoteAppKey){
            this.remoteAppKey = remoteAppKey;
            return this;
        }
        public Builder groupName(String groupName){
            this.groupName = groupName;
            return this;
        }

        public ChannelPara build(){
            return new ChannelPara(this);
        }
    }
}
